<template>
    <div class="goods_cell">

        <div class="left">
            <div class="image_box">
                <li-image :src="$getLogo(info.logo)" class="img" v-if="info.logo" />
                <img src="@/assets/images/home/goods.png" class="img" alt="" v-else>
            </div>
            <div class="info">
                <div class="top">
                    <div class="title">{{ info.name }}</div>
                    <div class="price">
                        <span class="unit">￥</span>
                        <span class="num">{{ info.price }}</span>
                        <span class="old">原价:￥<i>{{info.sellPrice}}</i></span>
                        <span>预约人数{{ info.initAppointmentCnt }}人</span>
                    </div>
                </div>
                <div class="time">有效期截止到{{ validityDay }}</div>
            </div>
        </div>

        <div class="btn_box">
            <nuxt-link :to="`/appoint?id=${info.id}&source=goods&hospitalId=${hospitalId}`" class="btn">立即抢购</nuxt-link>
            <!-- <div class="btn">立即抢购</div> -->
        </div>

    </div>
</template>
<script>
import moment from 'moment'
export default {
    name: 'DetailGoods',
    props: {
        info: {
            type: Object,
            default: function () {
                return {}
            }
        },
        hospitalId:{
            type: [String,Number],
            default:''
        }
    },
    data() {
        return {
            validityDay:''
        }
    },
    created(){
        this.validityDay = moment().add(90,'days').format('YYYY年MM月DD日')
    },
    methods: {
       
    }
}
</script>
<style lang="less" scoped>
@import './detail.less';
</style>